<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
	String path= request.getContextPath();
	System.out.print(path);
	String basePath = request.getScheme() + "://"    + request.getServerName() + ":" + request.getServerPort()    + path + "/";
%>
<html>
<head>
<title>chart</title>
<script type="text/javascript" src="<%=path %>/pages/admin/easyui/jquery-1.8.0.min.js"></script>
<script src="<%=path %>/pages/admin/js/highcharts.js"></script>
<script src="<%=path %>/pages/admin/js/modules/exporting.js"></script>
<script type="text/javascript">
//图表初始化
$(function () {
    var chart;
    var datejson = [
     {name:'钟公庙街道',y:45.0},     
     {name:'下应街道',y:26.8},
     {
         name: 'Chrome',
         y: 12.8,
         sliced: true,
         selected: true
     },
     {name:'集士港镇',y:8.5},
     {name:'石碶镇',y:6.2},
     {name:'其他',y:0.7}
 ]
    $(document).ready(function() {
    	$.ajax({
    		url:"<%=path %>/pages/admin/chart!chartJson.do",
    		type:"post",
    		success:function(data){
    			//alert(data);
    	
		        chart = new Highcharts.Chart({
		            chart: {
		                renderTo: 'container',
		                plotBackgroundColor: null,
		                plotBorderWidth: null,
		                plotShadow: false
		            },
		            title: {
		                text: '鄞州区企业分布统计饼图'
		            },
		            tooltip: {
		        	    pointFormat: '{series.name}: <b>{point.percentage}%</b>',
		            	percentageDecimals: 1
		            },
		            plotOptions: {
		                pie: {
		                    allowPointSelect: true,
		                    cursor: 'pointer',
		                    dataLabels: {
		                        enabled: true,
		                        color: '#000000',
		                        connectorColor: '#000000',
		                        formatter: function() {
		                            return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %';
		                        }
		                    }
		                }
		            },
		            series: [{
		                type: 'pie',
		                name: 'area',
		                data: data
		            }]
		        });
		   
	    	}
		});
    });
});
</script>
</head>
<body>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>
</body>
</html>